package com.qingcloud.adminbackend.entity.aline.adapters;

import com.alibaba.fastjson.JSON;
import com.qingcloud.adminbackend.entity.aline.CommandAdapter;

public abstract class ABaseTcpCommandAdapter<T>
        implements CommandAdapter<T> {
    private final T t;

    public ABaseTcpCommandAdapter(T t) {
        this.t = t;
    }

    @Override
    public String toReceiveJson() throws NoSuchFieldException, IllegalAccessException {
        return JSON.toJSONString(t);
    }

    @Override
    public abstract String getUrl(String baseUrl);

}
